class Unit:
    def __init__(self, unit_type):
        self.unit_type = unit_type

class PatternUnit(Unit):
    def __init__(self, value) -> None:
        super().__init__("pattern")
        self.value = value

class ConstantUnit(Unit):
    def __init__(self, value, _type):
        super().__init__("constant")
        self.value = value
        self._type = _type

class OperatorUnit(Unit):
    def __init__(self, _type, left_value, right_value):
        super().__init__(_type)
        self.left_value = left_value
        self.right_value = right_value

class AssignmentUnit(OperatorUnit):
    def __init__(self, left_value, right_value):
        super().__init__("assignment", left_value, right_value)
        self.operator = "="

class AddUnit(OperatorUnit):
    def __init__(self, left_value, right_value):
        super().__init__("add", left_value, right_value)
        self.operator = "+"
        
class SubUnit(OperatorUnit):
    def __init__(self, left_value, right_value):
        super().__init__("sub", left_value, right_value)
        self.operator = "-"
        
class MulUnit(OperatorUnit):
    def __init__(self, left_value, right_value):
        super().__init__("mul", left_value, right_value)
        self.operator = "*"
        
class DivUnit(OperatorUnit):
    def __init__(self, left_value, right_value):
        super().__init__("div", left_value, right_value)
        self.operator = "/"